{% extends "base.html" %}
{% block title %}Spreminjanje izpitnega roka{% endblock %}

{% block content %}


{% if only_search %}

<script type="text/javascript" src="{{ MEDIA_URL }}js/search.js"></script>
<script type="text/javascript">

$(document).ready(function(){    
	search_setcb('professor',function(professor){
      url = '/exams/modify_exam/'+professor.pk+'/';
      document.location = url;
    });
	
    
});
</script>
{% include "snippets/professor/search.htm" %}

{% else %}
<script type="text/javascript">

$(document).ready(function(){
    $('id_subject, label[for="id_subject"]').hide();
    $('id_subject, label[for="id_subject"]').parent().hide();
	$('id_special, label[for="id_special"]').hide();
    $('id_special, label[for="id_special"]').parent().hide();
	$('id_id, label[for="id_id"]').hide();
    $('id_id, label[for="id_id"]').parent().hide();
	
   $("#id_exam").change(function(){    
    selected_value = $('#id_exam option:selected').val();
    if (selected_value != undefined && selected_value != "") {
      document.location="/exams/modify_exam/{{ professor.pk }}/"+selected_value+"/";
    }
   });
   

});
</script>
<p>
  <b>Izbrani profesor: </b> {{ professor }}<br />
  {% if exam %}
  <b>Izbrani izpit: </b> {{ exam }}<br />
  {% endif %}
</p><br />
{% if win != '' %}
  <div class="info_msg">{{ win }}</div>
{% endif %}
<form method="post">
{% csrf_token %}
	{{ form.as_p }}
	{% if formsubmit %}
	<input type="submit" value="Shrani popravljene spremembe" />
	{% endif %}
</form>
{% endif %}

{% endblock %}>